package com.dxtx.activity;

import android.app.Activity;
import android.os.Bundle;


import com.dxtx.widget.DragAdapter;
import com.dxtx.widget.DragSortGridView;
import com.dxtx.widget.R;

import java.util.ArrayList;
import java.util.List;

public class MainActivity extends Activity {

    private DragSortGridView dragSortGridView;
    private DragAdapter dragAdapter;
    private List<String> list;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        initData();
        intView();
    }

    private void initData() {
        list = new ArrayList<String>();
        for (int i = 0; i < 50; i++) {
            list.add("" + i);
        }
    }

    private void intView() {
        dragSortGridView = (DragSortGridView) findViewById(R.id.dragSort1);
        dragSortGridView.setDragModel(DragSortGridView.DRAG_BY_LONG_CLICK);
        dragAdapter = new MyAdapter(this, list);
        dragSortGridView.setAdapter(dragAdapter);
    }
}
